package com.webserver.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class GetFileCreationDateExample {
    public static void main(String[] args){
        try {
            Process p = Runtime.getRuntime().exec("cmd /C dir f:\\./article/四月十四日学习知识.obj /tc");

            InputStream is = p.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String result;
            String getTime = null;
            while ((result = br.readLine()) != null) {
                String[] str = result.split(" ");
                for (int i = str.length - 1; i >= 0; i--) {
                    if (str[i].equals("./article/四月十四日学习知识.obj")) {
                        getTime = str[0] + " " + str[2];
                    }
                }
            }
            System.out.println("modifyInfoLoade.log 文件的创建日期是：" + getTime);
        } catch (IOException exc) {
            exc.printStackTrace();
        }
    }

    }

